package com.cet.ej.job;

import org.apache.shardingsphere.elasticjob.api.ShardingContext;
import org.apache.shardingsphere.elasticjob.simple.job.SimpleJob;

/**
 * 基于class，实现接口，编码织入
 * SimpleJob
 * @author 30952
 */

public class MySimpleJob implements SimpleJob {
    @Override
    public void execute(ShardingContext shardingContext) {
        // shardingContext包含作业配置、片和运行时信息
        // 获取分片总数
        int totalCount = shardingContext.getShardingTotalCount();
        // 获取本作业服务器分片序列号
        int shardingItem = shardingContext.getShardingItem();
        switch (shardingContext.getShardingItem()) {
            case 0:
                break;
            case 1:
                break;
            case 2:
                break;
        }
    }
}
